package com.hmall.item.domain.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;

import java.time.LocalDateTime;
import java.util.List;

/**
 * TODO
 *
 * @author Zhy
 * @version 1.0
 * @date 2025-03-23 10:42
 */
@Data
@ApiModel(description = "索引库实体")
public class ItemDoc {

	@ApiModelProperty("商品id")
	private String id;

	@ApiModelProperty("商品名称")
	private String name;

	@ApiModelProperty("价格（分）")
	private Integer price;

	@ApiModelProperty("库存")
	private Integer stock;

	@ApiModelProperty("商品图片")
	private String image;

	@ApiModelProperty("类目名称")
	private String category;

	@ApiModelProperty("品牌名称")
	private String brand;

	@ApiModelProperty("销量")
	private Integer sold;

	@ApiModelProperty("评论数")
	private Integer commentCount;

	@ApiModelProperty("是否是推广广告，true/false")
	private Boolean isAD;

	@ApiModelProperty("更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime updateTime;

	@ApiModelProperty("坐标")
	private GeoPoint location;

	// 商品属性
	@ApiModelProperty("商品规格")
	private List<Spec> attr_list;

	@Data
	public static class Spec {
		private String name;
		private String value;
	}

	//自动补全字段suggestion
	@ApiModelProperty("自动补全字段")
	private List<String> suggestion;

}
